<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@page import="com.lmpop.trade.ti_voucher.*" %>
<%@page import="java.util.*" %>
<%@page import="com.lmpop.trade.ts_custclass.*" %>
<html>
  <head>
    
    <title>优惠券管理</title>
	<link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="index.js"></script>
	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/engine.js'></script>
	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/util.js'></script>
	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/Ti_PaymentRulesInfo.js'></script> 
	
</head>

<body>

  <% 
  	String rule_id="";
  	if(request.getParameter("rule_id")!=null) rule_id = request.getParameter("rule_id");
  	Ti_PaymentRulesInfo ti_paymentrulesInfo = new Ti_PaymentRulesInfo();
  	List list = ti_paymentrulesInfo.getListByPk(rule_id);
  	Hashtable map = new Hashtable();
  	if(list!=null && list.size()>0) map = (Hashtable)list.get(0);
  	
  	String voucher_type="",limit_number="",member_level="";
  	if(map.get("voucher_type")!=null) voucher_type = map.get("voucher_type").toString();
  	if(map.get("limit_number")!=null) limit_number = map.get("limit_number").toString();
  	if(map.get("member_level")!=null) member_level = map.get("member_level").toString();
  	
  	Map custclassinfoMap = new Hashtable();
	custclassinfoMap.put("class_type","1");
	Ts_custclassInfo custclassinfo = new Ts_custclassInfo();
	String custclass_select =  custclassinfo.getSelectString(custclassinfoMap,member_level);
  %>
	
	<h1>修改优惠券管理</h1>

	<form action="/doTradeReg.do" method="post" name="updateRuleForm">
	<table width="100%" cellpadding="0" cellspacing="1" border="0" class="listtab">
		
		<tr>
			<td align="right" width="30%">
				优惠券类型<font color="red">*</font>
			</td>
			<td><input name="voucher_type" id="voucher_type" size="" maxlength="" value="<%=voucher_type %>" type="text" /></td>
		</tr>
		
		<tr >
			<td align="right" width="30%">
				会员级别
			</td>
			<td>
				<select name="member_level" id="member_level" >
									<option value="">请选择</option>
								  	<%=custclass_select%>
				</select>
		</tr>
		<tr>
			<td align="right" width="30%">
				限制数量<font color="red">*</font>
			</td>
			<td><input name="limit_number" id="limit_number" size="5" maxlength="5" value="<%=limit_number %>" type="text" onKeyUp="if(isNaN(value))this.value=''"/></td>
		</tr>
	</table>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td align="center">
				<input type="hidden" name="bpm_id" value="9012" />
	  			<input type="hidden" name="rule_id" value="<%=rule_id %>" />
				<input type="button" class="buttoncss" name="tradeSub" value="提交" onclick="return checkRule('updateRuleForm');"/>&nbsp;&nbsp;
				<input type="button" class="buttoncss" name="tradeRut" value="返回" onclick="window.location.href='paymentrules_index.jsp';"/>
			</td>
		</tr>
	</table>
	</form>
</body>

</html>

